package com.jwthhealth_pub.community.view;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.jwthhealth_pub.R;
import com.jwthhealth_pub.common.base.BaseActivity;
import com.jwthhealth_pub.common.view.TitleLayout;
import com.jwthhealth_pub.community.view.adapter.CommunityDocReportAdapter;
import com.jwthhealth_pub.community.view.adapter.CommunityDocReportTagsAdapter;

import butterknife.BindArray;
import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 医生 报告解读申请
 * Created by liuzhen on 2017/12/19.
 */

public class CommunityDocReportActivity extends BaseActivity {

    @BindView(R.id.title_layout)
    TitleLayout titleLayout;
    @BindView(R.id.rv_community_docreport_tags)
    RecyclerView rvCommunityDocreportTags;
    @BindView(R.id.rv_community_docreport_concent)
    RecyclerView rvCommunityDocreportConcent;
    @BindArray(R.array.reprot_state)
    String[] reportState;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_community_docreport);
        ButterKnife.bind(this);

        initReportNav();

        initReportCont();
    }

    private void initReportCont() {
        LinearLayoutManager lm = new LinearLayoutManager(this);
        lm.setOrientation(LinearLayoutManager.HORIZONTAL);
        rvCommunityDocreportTags.setLayoutManager(lm);
        rvCommunityDocreportTags.setAdapter(new CommunityDocReportTagsAdapter(this, reportState));
    }

    private void initReportNav() {
        rvCommunityDocreportConcent.setLayoutManager(new LinearLayoutManager(this));
        rvCommunityDocreportConcent.setAdapter(new CommunityDocReportAdapter(this));
    }

    @Override
    protected void title() {
        titleLayout.setOnTitleLayoutListener(new TitleLayout.TitleLayoutListener() {
            @Override
            public void leftclick() {
                finish();
            }

            @Override
            public void leftTextClick() {

            }

            @Override
            public void rightclick() {

            }

            @Override
            public void rightTextClick() {

            }
        });
    }


    public void gotoDetail() {
        startActivity(new Intent(this, CommunityDocReportDetialActivity.class));
    }
}
